package com.example.exceldemo.controller;

import com.example.exceldemo.entity.DocFolder;
import com.example.exceldemo.entity.Folder;
import com.example.exceldemo.service.ZipImpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description
 * @Author xiaohuang
 * @Date 2025/2/24
 */
@RequestMapping("zip")
@Api(tags = "zip解析")
@RestController
public class ZipImpController {
    @Autowired
    private ZipImpService zipImpService;

    @PostMapping("zipImp")
    @ApiOperation(value = "zip解压-文件夹-文件-测试")
    private List<DocFolder> zipImps(@RequestParam("file") MultipartFile file) {
        return zipImpService.zipImps(file);
    }

    @PostMapping("rarImp")
    @ApiOperation(value = "rar解压-文件夹-文件-测试")
    private List<DocFolder> rarImp(@RequestParam("file") MultipartFile file) {
        return zipImpService.rarImp(file);
    }

    @PostMapping("extract7z")
    @ApiOperation(value = "7z解压-文件夹-文件-测试")
    private List<DocFolder> extract7z(@RequestParam("file") MultipartFile file) {
        return zipImpService.extract7z(file);
    }
}
